import React from 'react'
import ReactDOM from 'react-dom'

// .children相当于引用组件时子节点,子节点可以用组数组

const Header = (props) => {
    return <header>
        { props.children[1] } 说 { props.children[0] }
    </header>
}

class Content extends React.Component {
    render () {
        return <section>
            { this.props.children }
        </section>
    }
}
const App = () => {
    return (
        <div>
            <Header>
                <h1>欢迎来到<i>react</i>都世界</h1>
                <div>I</div>
            </Header>
            <Content><i>react.js</i>核心库只关注于视图层</Content>
        </div>
    )
}

ReactDOM.render(
    <App />,
    document.getElementById('root')
)